import uiautomator2 as u2

d = u2.connect('emulator-5554')

if __name__ == '__main__':
    d.app_start("net.gsantner.markor")
    d(description="更多选项").click()
    d.xpath('//android.widget.ListView/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]').click()
    d(resourceId="net.gsantner.markor:id/create_folder_dialog__folder_name").click()
    d.send_keys('test_folder')
    d(resourceId="android:id/button1").click()
    d(text='test_folder').long_click()
    d(description="更多选项").click()
    d.xpath('//android.widget.ListView/android.widget.LinearLayout[2]').click()
